Image encoding method and device, and decoding method and device therefor

ABSTRACT

A video encoding method and apparatus and a video decoding method and apparatus. In the video encoding method, a first predicted coding unit of a current coding unit that is to be encoded is produced, a second predicted coding unit is produced by changing a value of each pixel of the first predicted coding unit by using each pixel of the first predicted coding unit and at least one neighboring pixel of each pixel, and the difference between the current coding unit and the second predicted coding unit is encoded, thereby improving video prediction efficiency.

This application is a National Stage of International Application No.PCT/KR2009/003634 filed Jul. 2, 2009, claiming priority based on U.S.Provisional Application No. 61/077,592 filed on Jul. 2, 2008, and KoreanPatent Application No. 10-2008-0085914 filed on Sep. 1, 2008, in theKorean Intellectual Property Office, the disclosures of which areincorporated herein by reference in their entireties.

BACKGROUND

1. Field

One or more aspects of the exemplary embodiments relate to a videoencoding method and apparatus and a video decoding method and apparatusare capable of improving video compression efficiency by post-processingpredicted video data.

2. Description of the Related Art

In an image compression method, such as Moving Picture Experts Group(MPEG)-1, MPEG-2, MPEG-4, or H.264/MPEG-4 Advanced Video Coding (AVC), apicture is divided into macroblocks in order to encode an image. Each ofthe macroblocks is encoded in all encoding modes that can be used ininter prediction or intra prediction, and then is encoded in an encodingmode that is selected according to a bitrate used to encode themacroblock and a distortion degree of a decoded macroblock based on theoriginal macroblock.

As hardware for reproducing and storing high resolution or high qualityvideo content is being developed and supplied, a need for a video codecfor effectively encoding or decoding the high resolution or high qualityvideo content is increasing. In a conventional video codec, a video isencoded in units of macroblocks each having a predetermined size.

SUMMARY

One or more aspects of the exemplary embodiments provide a videoencoding method and apparatus and a video decoding method and apparatusfor improving video compression efficiency.

According to an aspect of the exemplary embodiments, a new predictedblock is produced by changing a value of each pixel included in apredicted block by post-processing the predicted block.

According to an aspect of the exemplary embodiments, a new predictedblock is produced by changing a value of each pixel included in apredicted block by post-processing the predicted block, therebyimproving video compression efficiency.

According to an aspect of the exemplary embodiments, there is provided amethod of encoding video, the method comprising: producing a firstpredicted coding unit of a current coding unit that is to be encoded;producing a second predicted coding unit by changing a value of eachpixel of the first predicted coding unit by using each pixel of thefirst predicted coding unit and at least one neighboring pixel of eachpixel; and encoding the difference between the current coding unit andthe second predicted coding unit.

According to another aspect of the exemplary embodiments, there isprovided an an apparatus for encoding video, the apparatus comprising: apredictor for producing a first predicted coding unit of a currentcoding unit that is to be encoded; a post-processor for producing asecond predicted coding unit by changing a value of each pixel of thefirst predicted coding unit by using each pixel of the first predictedcoding unit and at least one neighboring pixel of each pixel; and anencoder for encoding the difference between the current coding unit andthe second predicted coding unit.

According to another aspect of the exemplary embodiments, there isprovided a method of decoding video, the method comprising: extractinginformation regarding a prediction mode of a current decoding unit,which is to be decoded, from a received bitstream; reproducing a firstpredicted decoding unit of the current decoding unit, based on theextracted information regarding the prediction mode; extractinginformation regarding an operation mode, in which each pixel of thefirst predicted decoding unit and neighboring pixels of each pixel areused, from the bitstream; reproducing a second predicted decoding unitby changing a value of each pixel of the first predicted decoding unitby using each pixel of the first predicted decoding unit and neighboringpixels of each pixel, based on the extracted information regarding theoperation mode; extracting a residual block, which is the differencebetween the current decoding unit and the second predicted decodingunit, from the bitstream and restoring the residual block; and decodingthe current decoding unit by adding the residual block to the secondpredicted decoding unit.

According to another aspect of the exemplary embodiments, there isprovided an apparatus for decoding video, the apparatus comprising: anentropy decoder for extracting information regarding a prediction modeof a current decoding unit, which is to be decoded, and informationregarding an operation mode, in which each pixel of a first predicteddecoding unit of the current decoding unit and neighboring pixels ofeach pixel of the first predicted decoding unit are used, from areceived bitstream; a predictor for reproducing the first predicteddecoding unit, based on the extracted information regarding theprediction mode; a post-processor for reproducing a second predicteddecoding unit by changing a value of each pixel of the first predicteddecoding unit by using each pixel of the first predicted decoding unitand neighboring pixels of each pixel of the first predicted decodingunit, based on the extracted information regarding the operation mode;an inverse transformation and inverse quantization unit for reproducinga residual block that is the difference between the current decodingunit and the second predicted decoding unit, from the bitstream; and anadder for decoding the current decoding unit by adding the residualblock to the second predicted decoding unit.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram of a video encoding apparatus according to anexemplary embodiment.

FIG. 2 is a block diagram of a video decoding apparatus according to anexemplary embodiment.

FIG. 3 is a diagram for describing a concept of hierarchical codingunits according to an exemplary embodiment.

FIG. 4 is a block diagram of an image encoder based on coding unitsaccording to an exemplary embodiment.

FIG. 5 is a block diagram of an image decoder based on coding unitsaccording to an exemplary embodiment.

FIG. 6 is a diagram illustrating deeper coding units according todepths, and a prediction unit according to an exemplary embodiment.

FIG. 7 is a diagram for describing a relationship between a coding unitand a transformation unit, according to an exemplary embodiment.

FIG. 8 is a diagram for describing encoding information of coding unitscorresponding to a coding depth, according to an exemplary embodiment.

FIG. 9 is a diagram of deeper coding units according to depths,according to an exemplary embodiment.

FIGS. 10A and 10B are diagrams illustrating a relationship between acoding unit, a prediction unit, and a transformation unit, according toan exemplary embodiment.

FIG. 11 is a table showing encoding information regarding each codingunit according to an exemplary embodiment.

FIG. 12 is a block diagram of an intra prediction apparatus according toan exemplary embodiment.

FIG. 13 is a table showing a number of intra prediction modes accordingto the size of a coding unit, according to an exemplary embodiment.

FIGS. 14A to 14C are diagrams for explaining intra prediction modes thatmay be performed on a coding unit having a predetermined size, accordingto exemplary embodiments.

FIG. 15 is drawings for explaining intra prediction modes that may beperformed on a coding unit having a predetermined size, according toother exemplary embodiments.

FIG. 16 is a reference diagram for explaining inter prediction modeshaving various directionalities according to an exemplary embodiment.

FIG. 17 is a reference diagram for explaining a bi-linear mode accordingto an exemplary embodiment.

FIG. 18 is a reference diagram for explaining post-processing of a firstpredicted coding unit, according to an exemplary embodiment.

FIG. 19 is a reference diagram for explaining an operation of apost-processor according to an exemplary embodiment.

FIG. 20 is a reference diagram for explaining neighboring pixels to beused by a post-processor according to an exemplary embodiment.

FIG. 21 is a flowchart illustrating a method of encoding video accordingto an exemplary embodiment.

FIG. 22 is a flowchart illustrating a method of decoding video accordingto an exemplary embodiment.

DETAILED DESCRIPTION OF EXEMPLARY EMBODIMENTS

Hereinafter, a video encoding method and apparatus and a video decodingmethod and apparatus according to exemplary embodiments, will bedescribed with reference to the accompanying drawings.

FIG. 1 is a block diagram of a video encoding apparatus 100 according toan exemplary embodiment. The video encoding apparatus 100 includes amaximum coding unit splitter 110, a coding depth determiner 120, animage data encoder 130, and an encoding information encoder 140.

The maximum coding unit splitter 110 may split a current picture orslice of an image, based on a maximum coding unit. The current pictureor slice may be split into at least one maximum coding unit. The resultof splitting may be output to the coding depth determiner 120 accordingto the at least one maximum coding unit.

According to an exemplary embodiment, coding unit may be characterizedby a maximum coding unit and a depth. The maximum coding unit means alargest coding unit from among coding units of a current picture. Thedepth means a number of times a coding unit is hierarchically split fromthe maximum coding unit. As the depth deepens, deeper coding unitsaccording to depths may be split from the maximum coding unit to aminimum coding unit. A depth of the maximum coding unit may be anuppermost depth and a depth of the minimum coding unit may be alowermost depth. Since a size of a coding unit corresponding to eachdepth decreases as the depth of the maximum coding unit deepens, acoding unit having a depth value ‘k’ may include a plurality of codingunits each having a depth value larger than ‘k+1’.

As described above, the image data of the current picture is split intothe maximum coding units according to a maximum size of the coding unit,and each of the maximum coding units may include deeper coding unitsthat are split according to depths. Since the maximum coding unitaccording to an exemplary embodiment is split according to depths, theimage data of a spatial domain included in the maximum coding unit maybe hierarchically classified according to depths.

A maximum depth and a maximum size of a coding unit, which limit thetotal number of times a height and width of the maximum coding unit arehierarchically split, may be predetermined. The maximum coding unit andthe maximum depth may be set in picture or slice units. That is, each ofthe picture or slice units may have a different maximum coding unit anda different maximum depth, and the size of a minimum coding unitincluded in the maximum coding unit may be variably set according to themaximum depth. Since a maximum coding unit and a maximum depth may bevariably set for each of the picture or slice units, video compressionefficiency may be improved by encoding an image having a planar regionby using the maximum coding unit having a relatively large size, andencoding an image having high complexity by using a coding unit having arelatively small size.

The coding depth determiner 120 determines a maximum depth in such amanner that different maximum depths are assigned to maximum codingunits, respectively. The maximum depth may be determined based onrate-distortion (R-D) cost calculation. The determined maximum depth isprovided to the encoding information encoder 140, and the image data ofthe maximum coding unit is transmitted to the image data encoder 130.

The image data in the maximum coding unit is encoded based on the deepercoding units corresponding to at least one depth equal to or below themaximum depth, and results of encoding the image data are compared basedon each of the deeper coding units. A depth having the least encodingerror may be selected after comparing encoding errors. At least onecoding depth may be selected for each maximum coding unit.

The size of the maximum coding unit is split as a coding unit ishierarchically split according to depths, and as the number of codingunits increases. Also, even if coding units correspond to same depth inone maximum coding unit, it is determined whether to split each of thecoding units corresponding to the same depth to an upper depth bymeasuring an encoding error of the image data of the each coding unit,separately. Accordingly, even when image data is included in one maximumcoding unit, the image data is split to regions according to the depthsand the encoding errors may differ according to regions in the onemaximum coding unit, and thus the coding depths may differ according toregions in the image data. Thus, one or more coding depths may bedetermined in one maximum coding unit, and the image data of the maximumcoding unit may be divided according to coding units of at least onecoding depth.

Also, sub coding units having different sizes, which are included in themaximum coding unit, may be predicted or transformed based on processingunits having different sizes, respectively. In other words, the videoencoding apparatus 100 may perform a plurality of operations for videoencoding, based on processing units having different sizes and shapes.Encoding of video data includes various operations, e.g., prediction,transformation, and entropy encoding. Processing units having the samesize may be used in all of the various operations, or processing unitshaving different sizes may be used in the various operations,respectively.

For example, the video encoding apparatus 100 may select a processingunit that is different from a coding unit, so as to predict the codingunit. If the size of the coding unit is 2N×2N, then the size of theprocessing unit may be, for example, 2N×2N, 2N×N, N×2N, or N×N. Here, Ndenotes a positive integer. In other words, motion prediction may beperformed in processing units obtained by splitting at least one of theheight and width of the coding unit into two equal parts. Hereinafter, adata unit on which prediction is performed based will be referred to asa ‘prediction unit’.

A prediction mode may include at least one from among an intra mode, ainter mode, and a skip mode. A particular prediction mode may beperformed only on prediction units each having a predetermined size orshape. For example, the intra mode may be performed only on a predictionunit of 2N×2N or N×N. Also, the skip mode may be performed only on aprediction unit of 2N×2N. If a plurality of prediction units areincluded in a coding unit, prediction may be independently performed onthe plurality of prediction units, and a prediction mode having a leastencoding error may be selected.

The video encoding apparatus 100 may also perform the transformation onthe image data in a coding unit based not only on the coding unit forencoding the image data, but also based on a data unit that is differentfrom the coding unit. In order to perform the transformation in thecoding unit, the transformation may be performed based on a data unithaving a size smaller than or equal to the coding unit. A data unit usedas a base of the transformation will now be referred to as a‘transformation unit’.

The coding depth determiner 120 may determine a form into which themaximum coding unit is to be split in such a manner that the maximumcoding unit may have an optimum encoding error, by measuring encodingerrors of coding units corresponding to depths by using Lagrangianmultiplier-based rate-distortion optimization. In other words, thecoding depth determiner 120 may determine the type of sub coding unitsinto which the maximum coding unit is split. Here, the size of each ofthe sub coding units varies according to a corresponding depth.

The image data encoder 130 encodes the image data of the maximum codingunit, based on the at least one coding depth determined by the codingdepth determiner 120, and outputs the result of encoding in a bitstream.Since encoding has already been performed by the coding depth determiner120 so as to measure the least encoding error, an encoded data streammay be output by using the result of encoding.

The encoding information encoder 140 encodes information about anencoding mode corresponding to each depth for each maximum coding unit,based on at least one coding depth determined by the coding depthdeterminer 120, and then outputs the result of encoding in a bitstream.The information about the encoding mode according to each depth mayinclude information regarding the at least one coding depth, thepartition type of a prediction unit of a coding unit having the at leastone coding depth, a prediction mode of each prediction unit, and thesize of a transformation unit.

The information about the coding depth may be defined by using splitinformation according to depths, which indicates whether encoding isperformed on coding units of an upper depth instead of a current depth.If the current depth of the current coding unit is the coding depth,image data in the current coding unit is encoded and output, and thusthe split information may be defined not to split the current codingunit to an upper depth. Alternatively, if the current depth of thecurrent coding unit is not the coding depth, the encoding is performedon the coding unit of the upper depth, and thus the split informationmay be defined to split the current coding unit to obtain the codingunits of the upper depth.

If the current depth is not the coding depth, encoding is performed onthe coding unit that is split into the coding unit of the upper depth.Since at least one coding unit of the upper depth exists in one codingunit of the current depth, the encoding is repeatedly performed on eachcoding unit of the upper depth, and thus the encoding may be recursivelyperformed for the coding units having the same depth.

Since at least one coding depth should be determined for one maximumcoding unit and information about at least one encoding mode should bedetermined for each coding depth, information about at least oneencoding mode may be determined for one maximum coding unit. Also, acoding depth of the image data of the maximum coding unit may bedifferent according to locations since the image data is hierarchicallysplit according to depths, and thus information about the coding depthand the encoding mode may be set for the image data.

Accordingly, according to an exemplary embodiment, the encodinginformation encoder 140 may set encoding information about a codingdepth of each minimum unit included in the maximum coding unit. That is,a coding unit having a coding depth includes at least one minimum codingunit that contains the same encoding information. Thus, if adjacentminimum coding units have the same encoding information according todepths, the adjacent minimum coding units may be minimum coding unitsincluded in the same maximum coding unit.

In the video encoding apparatus 100, the deeper coding unit may be acoding unit obtained by dividing a height or width of a coding unit of alower depth, which is one layer above, by two. In other words, when thesize of the coding unit of the current depth k is 2N×2N, the size of thecoding unit of the upper depth (k+1) is N×N. Also, the coding unit ofthe current depth having the size of 2N×2N may include maximum 4 of thecoding unit of the upper depth having the size of N×N.

Accordingly, the video encoding apparatus 100 may determine an optimumsplit form for each maximum coding unit, based on the size of themaximum coding unit and the maximum depth determined consideringcharacteristics of the current picture. Also, since encoding may beperformed on each maximum coding unit by using any one of variousprediction modes and transformations, an optimum encoding mode may bedetermined considering characteristics of the coding unit of variousimage sizes.

If an image having high resolution or large data amount is encoded in aconventional macroblock, a number of macroblocks per picture excessivelyincreases. Accordingly, a number of pieces of compressed informationgenerated for each macroblock increases, and thus it is difficult totransmit the compressed information and data compression efficiencydecreases. However, by using the video encoding apparatus 100, imagecompression efficiency may be increased since a coding unit is adjustedwhile considering characteristics of an image while increasing a maximumsize of a coding unit while considering a size of the image.

FIG. 2 is a block diagram of a video decoding apparatus 200 according toan exemplary embodiment.

The video decoding apparatus 200 includes an image data obtaining unit210, an encoding information extractor 220, and an image data decoder230.

The image data obtaining unit 210 parses a bitstream received by thevideo decoding apparatus 200 so as to obtain image data in maximumcoding units, and transmits the image data to the image data decoder230. The image data obtaining unit 210 may extract information regardingmaximum coding units of a current picture or slice from a header of thecurrent picture or slice. According to an exemplary embodiment, thevideo decoding apparatus 200 decodes the image data in the maximumcoding units.

The encoding information extractor 220 parses the bitstream to extractinformation about a coding depth and an encoding mode for each of themaximum coding units from the header of the current picture or slice.The extracted information about the coding depth and the encoding modeis output to the image data decoder 230.

The information about the coding depth and the encoding mode accordingto the maximum coding unit may be set for information about at least onecoding unit corresponding to the coding depth, and information about anencoding mode may include information about a partition type of acorresponding coding unit corresponding to the coding depth, about aprediction mode, and a size of a transformation unit. Also, splittinginformation according to depths may be extracted as the informationabout the coding depth.

Information regarding a form into which each of the maximum coding unitsis split may contain information regarding sub coding units havingdifferent sizes according to a depth of each of the maximum codingunits. The information regarding the encoding mode may containinformation regarding a prediction unit for each of the sub codingunits, information regarding the prediction mode, information of thetransformation unit, etc.

The image data decoder 230 reconstructs the current picture or slice bydecoding the image data of each of the maximum coding units, based onthe information extracted by the encoding information extractor 220. Theimage data decoder 230 may decode the sub coding units included in eachof the maximum coding units, based on the information regarding a forminto which each of the maximum coding units is split. The decoding mayinclude intra prediction, motion estimation that includes motioncompensation, and inverse transformation.

The image data decoder 230 restores the current picture by decoding theimage data in each maximum coding unit based on the information aboutthe coding depth and the encoding mode according to the maximum codingunits. In other words, the image data decoder 230 may decode the encodedimage data based on the extracted information about the partition type,the prediction mode, and the transformation unit for each coding unitfrom included in each maximum coding unit. A decoding process mayinclude a prediction including intra prediction and motion compensation,and an inverse transformation.

The image data decoder 230 may perform intra prediction or motioncompensation according to a partition and a prediction mode of eachcoding unit, based on the information about the partition type and theprediction mode of the prediction unit of the coding unit according tocoding depths. Also, the image data decoder 230 may perform inversetransformation according to each transformation unit in the coding unit,based on the information about the size of the transformation unit ofthe coding unit according to coding depths, so as to perform the inversetransformation according to maximum coding units.

The image data decoder 230 may determine at least one coding depth of acurrent maximum coding unit by using split information according todepths. If the split information indicates that image data is no longersplit in the current depth, the current depth is a coding depth.Accordingly, the image data decoder 230 may decode encoded data of atleast one coding unit corresponding to the each coding depth in thecurrent maximum coding unit by using the information about the partitiontype of the prediction unit, the prediction mode, and the size of thetransformation unit for each coding unit corresponding to the codingdepth, and output the image data of the current maximum coding unit.

The video decoding apparatus 200 may obtain information about at leastone coding unit that generates the least encoding error when encoding isrecursively performed for each maximum coding unit, and may use theinformation to decode the current picture. In other words, the optimumcoding units in each maximum coding unit may be decoded. Accordingly,even if image data has high resolution and a large amount of data, theimage data may be efficiently decoded and restored by using a size of acoding unit and an encoding mode, which are adaptively determinedaccording to characteristics of the image data, by using informationabout an optimum encoding mode received from an encoder.

FIG. 3 is a diagram for describing a concept of hierarchical codingunits according to an exemplary embodiment.

Referring to FIG. 3, the hierarchical coding units according to thecurrent embodiment may include a 64×64 coding unit, a 32×32 coding unit,a 16×16 coding unit, an 8×8 coding unit, and a coding unit 4×4. However,the exemplary embodiment is not limited thereto, and the size of acoding unit may be, for example, 64×32,32×64, 32×16, 16×32, 16×8, 8×16,8×4, or 4×8.

In video data 310, a resolution is 1920×1080, a maximum size of a codingunit is 64, and a maximum depth is 2. In video data 320, a resolution is1920×1080, a maximum size of a coding unit is 64, and a maximum depth is4. In video data 330, a resolution is 352×288, a maximum size of acoding unit is 16, and a maximum depth is 2.

If a resolution is high or a data amount is large, a maximum size of acoding unit may be large so as to not only increase encoding efficiencybut also to accurately reflect characteristics of an image. Accordingly,the maximum size of the coding unit of the video data 310 and 320 havingthe higher resolution than the video data 330 may be 64.

Since the maximum depth of the video data 310 is 2, coding units 315 ofthe vide data 310 may include a maximum coding unit having a long axissize of 64, and coding units having long axis sizes of 32 and 16 sincedepths are deepened to two layers by splitting the maximum coding unittwice. Meanwhile, since the maximum depth of the video data 330 is 2,coding units 335 of the video data 330 may include a maximum coding unithaving a long axis size of 16, and coding units having a long axis sizeof 8 or 4 since depths are deepened to two layer by splitting themaximum coding unit twice.

Since the maximum depth of the video data 320 is 4, coding units 325 ofthe video data 320 may include a maximum coding unit having a long axissize of 64, and coding units having long axis sizes of 32, 16, 8 and 4since the depths are deepened to 4 layers by splitting the maximumcoding unit four times. As a depth deepens, detailed information may beprecisely expressed.

FIG. 4 is a block diagram of an image encoder 400 based on coding units,according to an exemplary embodiment.

Referring to FIG. 4, an intra predictor 410 performs intra prediction oncoding units in an intra mode, from among a current frame 405, and amotion estimator 420 and a motion compensator 425 performs interestimation and motion compensation on coding units in an inter mode fromamong the current frame 405 by using the current frame 405, and areference frame 495.

Data output from the intra predictor 410, the motion estimator 420, andthe motion compensator 425 is output as a quantized transformationcoefficient through a transformer 430 and a quantizer 440. Inparticular, as will be described later with reference to FIG. 12, theintra predictor 410 may perform post-processing, in which a value ofeach pixel of an intra-predicted coding unit is changed usingneighboring pixels. Residual values that are the differences between thevalues of the post-processed coding unit and the original coding unit,may be sequentially output to the transformer 430 and the quantizer 440,and then be finally output as a quantized transformation coefficient.

The quantized transformation coefficient is restored as data in aspatial domain through an inverse quantizer 460 and an inversetransformer 470, and the restored data in the spatial domain is outputas the reference frame 495 after being post-processed through adeblocking unit 480 and a loop filtering unit 490. The quantizedtransformation coefficient may be output as a bitstream 455 through anentropy encoder 450.

In order for the image encoder 400 to be applied in the video encodingapparatus 100, all elements of the image encoder 400, i.e., the intrapredictor 410, the motion estimator 420, the motion compensator 425, thetransformer 430, the quantizer 440, the entropy encoder 450, the inversequantizer 460, the inverse transformer 470, the deblocking unit 480, andthe loop filtering unit 490 perform operations based on each coding unitfrom among coding units having a tree structure while considering themaximum depth of each maximum coding unit. Specifically, the intrapredictor 410, the motion estimator 420, and the motion compensator 425determines partitions and a prediction mode of each coding unit fromamong the coding units having a tree structure while considering themaximum size and the maximum depth of a current maximum coding unit, andthe transformer 430 determines the size of the transformation unit ineach coding unit from among the coding units having a tree structure.

FIG. 5 is a block diagram of an image decoder 500 based on coding units,according to an exemplary embodiment.

A parser 510 parses encoded image data to be decoded and informationabout encoding required for decoding from a bitstream 505. The encodedimage data is output as inverse quantized data through an entropydecoder 520 and an inverse quantizer 530, and the inverse quantized datais restored to image data in a spatial domain through an inversetransformer 540. The image data in the spatial domain, which passedthrough the intra predictor 550 and the motion compensator 560, may beoutput as a restored frame 595 after being post-processed through adeblocking unit 570 and a loop filtering unit 580. Also, the image datathat is post-processed through the deblocking unit 570 and the loopfiltering unit 580 may be output as the reference frame 585.

In order for the image decoder 500 to be applied in the video decodingmethod according to an exemplary embodiment, all elements of the imagedecoder 500, i.e., the parser 510, the entropy decoder 520, the inversequantizer 530, the inverse transformer 540, the intra predictor 550, themotion compensator 560, the deblocking unit 570, and the loop filteringunit 580 perform operations based on coding units having a treestructure for each maximum coding unit. Specifically, the intraprediction 550 and the motion compensator 560 perform operations basedon partitions and a prediction mode for each of the coding units havinga tree structure, and the inverse transformer 540 perform operationsbased on a size of a transformation unit for each coding unit.

FIG. 6 is a diagram illustrating deeper coding units according todepths, and partitions, according to an exemplary embodiment. The videoencoding apparatus 100 and the video decoding apparatus 200 usehierarchical coding units so as to consider characteristics of an image.A maximum height, a maximum width, and a maximum depth of coding unitsmay be adaptively determined according to the characteristics of theimage, or may be differently set by a user. Sizes of coding unitsaccording to depths may be determined according to the predeterminedmaximum size of the coding unit.

In a hierarchical structure 600 of coding units, according to anexemplary embodiment, the maximum height and the maximum width of thecoding units are each 64, and the maximum depth is 4. Since a depthdeepens along a vertical axis of the hierarchical structure 600, aheight and a width of the deeper coding unit are each split. Also, aprediction unit and partitions, which are bases for prediction encodingof each deeper coding unit, are shown along a horizontal axis of thehierarchical structure 600.

In other words, a maximum coding unit 610 is a maximum coding unit inthe hierarchical structure 600, wherein a depth is 0 and a size, i.e., aheight by width, is 64×64. The depth deepens along the vertical axis,and a coding unit 620 having a size of 32×32 and a depth of 1, a codingunit 630 having a size of 16×16 and a depth of 2, a coding unit 640having a size of 8×8 and a depth of 3, and a coding unit 650 having asize of 4×4 and a depth of 4 exist. The coding unit 650 having the sizeof 4×4 and the depth of 4 is a minimum coding unit.

Also, referring to FIG. 6, partitions of each coding unit are arrangedas prediction units of the coding unit according to a depth and alongthe horizontal axis. In other words, prediction units of the maximumcoding unit 610 having a size of 64×64 and a depth of 0 may include themaximum coding unit 610 having a size of 64×64, and partitions includedin the maximum coding unit 610, i.e., partitions 612 having the size of64×32, partitions 614 having the size of 32×64, and partitions 616having the size of 32×32.

Similarly, a prediction unit of the coding unit 620 having the size of32×32 and the depth of 1 may be split into partitions included in thecoding unit 620, i.e. a partition 620 having a size of 32×32, partitions622 having a size of 32×16, partitions 624 having a size of 16×32, andpartitions 626 having a size of 16×16.

Similarly, a prediction unit of the coding unit 630 having the size of16×16 and the depth of 2 may be split into partitions included in thecoding unit 630, i.e. a partition having a size of 16×16 included in thecoding unit 630, partitions 632 having a size of 16×8, partitions 634having a size of 8×16, and partitions 636 having a size of 8×8.

Similarly, a prediction unit of the coding unit 640 having the size of8×8 and the depth of 3 may be split into partitions included in thecoding unit 640, i.e. a partition having a size of 8×8 included in thecoding unit 640, partitions 642 having a size of 8×4, partitions 644having a size of 4×8, and partitions 646 having a size of 4×4.

The coding unit 650 having the size of 4×4 and the depth of 4 is theminimum coding unit and a coding unit of the lowermost depth. Aprediction unit of the coding unit 650 is only assigned to a partitionhaving a size of 4×4.

In order to determine the at least one coding depth of the coding unitsconstituting the maximum coding unit 610, the coding depth determiner120 of the video encoding apparatus 100 performs encoding for codingunits corresponding to each depth included in the maximum coding unit610.

A number of deeper coding units according to depths including data inthe same range and the same size increases as the depth deepens. Forexample, four coding units corresponding to a depth of 2 are required tocover data that is included in one coding unit corresponding to a depthof 1. Accordingly, in order to compare encoding results of the same dataaccording to depths, the coding unit corresponding to the depth of 1 andfour coding units corresponding to the depth of 2 are each encoded.

In order to perform encoding for a current depth from among the depths,a least encoding error may be selected for the current depth byperforming encoding for each prediction unit in the coding unitscorresponding to the current depth, along the horizontal axis of thehierarchical structure 600. Alternatively, the least encoding error maybe searched for by comparing the least encoding errors according todepths, by performing encoding for each depth as the depth deepens alongthe vertical axis of the hierarchical structure 600. A depth and apartition having the least encoding error in the maximum coding unit 610may be selected as the coding depth and a partition type of the maximumcoding unit 610.

FIG. 7 is a diagram for describing a relationship between a coding unit710 and transformation units 720, according to an exemplary embodiment.

The video encoding apparatus 100 or the video decoding apparatus 200encodes or decodes an image according to coding units having sizessmaller than or equal to a maximum coding unit for each maximum codingunit. Sizes of transformation units for transformation during encodingmay be selected based on data units that are not larger than acorresponding coding unit. For example, in the video encoding apparatus100 or 200, if a size of the coding unit 710 is 64×64, transformationmay be performed by using the transformation units 720 having a size of32×32. Also, data of the coding unit 710 having the size of 64×64 may beencoded by performing the transformation on each of the transformationunits having the size of 32×32, 16×16, 8×8, and 4×4, which are smallerthan 64×64, and then a transformation unit having the least coding errormay be selected.

FIG. 8 is a diagram for describing encoding information of coding unitscorresponding to a coding depth, according to an exemplary embodiment.The encoding information encoder 140 of the video encoding apparatus 100may encode and transmit information-partition type 800 about a partitiontype, information-prediction mode 810 about a prediction mode, andinformation-transformation unit 820 about a size of a transformationunit for each coding unit corresponding to a coding depth, asinformation about an encoding mode.

The information-partition type 800 indicates information about a shapeof a partition obtained by splitting a prediction unit of a currentcoding unit, wherein the partition is a data unit for predictionencoding the current coding unit. For example, a current coding unitCU_0 having a size of 2N×2N may be split into any one of a partition 802having a size of 2N×2N, a partition 804 having a size of 2N×N, apartition 806 having a size of N×2N, and a partition 808 having a sizeof N×N. Here, the information-partition type 800 about a partition typeis set to indicate one of the partition 804 having a size of 2N×N, thepartition 806 having a size of N×2N, and the partition 808 having a sizeof N×N.

The information-prediction mode 810 indicates a prediction mode of eachpartition. For example, the information-prediction mode 810 may indicatea mode of prediction encoding performed on a partition indicated by theinformation-partition type 800, i.e., an intra mode 812, an inter mode814, or a skip mode 816.

The information-transformation unit 820 indicates a transformation unitto be based on when transformation is performed on a current codingunit. For example, the transformation unit may be a first intratransformation unit 822, a second intra transformation unit 824, a firstinter transformation unit 826, or a second intra transformation unit828.

The encoding information extractor 220 of the video decoding apparatus200 may extract and use the information-partition type 800,information-prediction mode 810, and information-transformation unit 820for decoding, according to each deeper coding unit.

FIG. 9 is a diagram of deeper coding units according to depths,according to an exemplary embodiment. Split information may be used toindicate a change of a depth. The spilt information indicates whether acoding unit of a current depth is split into coding units of an upperdepth.

A prediction unit 910 for motion-prediction encoding a coding unit 900having a depth of 0 and a size of 2N_(—)0×2N_(—)0, may includepartitions of a partition type 912 having a size of 2N_(—)0×2N_(—)0, apartition type 914 having a size of 2N_(—)0×N_(—)0, a partition type 916having a size of N_(—)0×2N_(—)0, and a partition type 918 having a sizeof N_(—)0×N_(—)0.

Motion-prediction encoding is repeatedly performed on one partitionhaving a size of 2N_(—)0×2N_(—)0, two partitions having a size of2N_(—)0×N_(—)0, two partitions having a size of N_(—)0×2N_(—)0, and fourpartitions having a size of N_(—)0×N_(—)0, according to each partitiontype. An intra mode and the motion-prediction encoding in an inter modemay be performed on the partitions having the sizes of 2N_(—)0×2N_(—)0,N_(—)0×2N_(—)0, 2N_(—)0×N_(—)0, and N_(—)0×N_(—)0. The predictionencoding in a skip mode is performed only on the partition having thesize of 2N_(—)0×2N_(—)0.

If an encoding error is the smallest in the partition type 918 having asize of N_(—)0×N_(—)0, a depth is changed from ‘0’ to ‘1’ to split thepartition type 918 in operation 920, and encoding is repeatedlyperformed on coding units 922, 924, 926 and 928 having a depth of 2 anda size of N_(—)0×N_(—)0 to search for a least encoding error.

Since encoding is repeatedly performed on the coding units 922, 924,926, and 928 having the same depth, encoding of a coding unit having adepth of 1 will be described by using a coding unit from among thecoding units 922, 924, 926, and 928. A prediction unit 930 formotion-predicting a coding unit having a depth of 1 and a size of2N_(—)1×2N_(—)1(=N_(—)0×N_(—)0), may include partitions of a partitiontype 932 having a size of 2N_(—)1×2N_(—)1, a partition type 934 having asize of 2N_(—)1×N_(—)1, a partition type 936 having a size ofN_(—)1×2N_(—)1, and a partition type 938 having a size of N_(—)1×N_(—)1.Encoding is repeatedly performed on one partition having a size of2N_(—)1×2N_(—)1, two partitions having a size of 2N_(—)1×N_(—)1, twopartitions having a size of N_(—)1×2N_(—)1, and four partitions having asize of N_(—)1×N_(—)1, according to each partition type and by usingmotion estimation.

If the encoding error is the smallest in the partition type 938 havingthe size of N_(—)1×N_(—)1, the current depth is increased from ‘1’ to‘2’ in operation 940, and encoding is repeatedly performed on codingunits 942, 944, 946, and 948 having a depth of 2 and a size ofN_(—)2×N_(—)2 so as to search for a least encoding error.

If a maximum depth is ‘d’, then split information corresponding todepths may be set to a depth of (d−1). That is, a prediction unit 950for motion-predicting a coding unit having a depth of d−1 and a size of2N_(d−1)×2N_(d_(—)1), may include partitions of a partition type 952having a size of 2N_(d−1)×2N_(d_(—)1), a partition type 954 having asize of 2N_(d−1)×N_(d_(—)1), a partition type 956 having a size ofN_(d−1)×2N_(d_(—)1), and a partition type 958 having a size ofN_(d−1)×N_(d_(—)1).

Encoding is repeatedly performed on one partition having a size of2N_(d−1)×2N_(d_(—)1), two partitions having a size of2N_(d−1)×N_(d_(—)1), two partitions having a size ofN_(d−1)×2N_(d_(—)1), and four partitions having a size ofN_(d−1)×N_(d_(—)1), according to each partition type and by using motionestimation. Since the maximum depth is ‘d’, the coding unit 952 havingthe depth of (d−1) is not any more split.

The video encoding apparatus 100 according to an exemplary embodimentcompares encoding errors according to depths with one another andselects a depth corresponding to the least encoding error, so as todetermine a coding depth for the partition type 912. For example, incase of a coding unit having a depth of 0, the partition types 912, 914,916, and 918 are individually encoded by performing motion estimationthereon, and a prediction unit having a least encoding error is selectedfrom among the partition types 912, 914, 916, and 918. Similarly, aprediction unit having a least encoding error may be determined for eachof depths of 0, 1, . . . , d−1. In the case of the depth of d, anencoding error may be determined by performing motion estimation basedon a prediction unit 960 that is a coding unit having a size of2N_d×2N_d. As described above, the least encoding errors correspondingto the depths of 0, 1, . . . , d−1 are compared with one another, and adepth having a least encoding error is selected as a coding depth fromamong the least encoding errors. The coding depth and a prediction unitcorresponding to the coding depth may be encoded and transmitted asinformation regarding an encoding mode. Also, since a coding unit shouldbe split from the depth of 0 to the coding depth, only split informationregarding the coding depth is set to ‘0’, and split informationregarding the other depths is set to ‘1’.

The encoding information extractor 220 of the video decoding apparatus200 may extract and use the information about the coding depth and theprediction unit of the coding unit 900 to decode the partition 912. Thevideo decoding apparatus 200 may determine a depth, in which splitinformation is 0, as a coding depth by using split information accordingto depths, and use information about an encoding mode of thecorresponding depth for decoding.

FIGS. 10A and 10B are diagrams for describing a relationship betweencoding units 1010, prediction units 1060, and transformation units 1070,according to an exemplary embodiment.

The coding units 1010 are coding units corresponding to coding depthsdetermined by the video encoding apparatus 100, for a maximum codingunit. The prediction units 1060 are partitions of prediction units ofeach of the coding units 1010, and the transformation units 1070 aretransformation units of each of the coding units 1010.

When a depth of a maximum coding unit is 0 in the coding units 1010,depths of coding units 1012 and 1054 are 1, depths of coding units 1014,1016, 1018, 1028, 1050, and 1052 are 2, depths of coding units 1020,1022, 1024, 1026, 1030, 1032, and 1048 are 3, and depths of coding units1040, 1042, 1044, and 1046 are 4.

In the prediction units 1060, some prediction units 1014, 1016, 1022,1032, 1048, 1050, 1052, and 1054 are obtained by splitting the codingunits in the coding units 1010. In other words, the prediction units1014, 1022, 1050, and 1054 are partition type having a size of 2N×N, theprediction unit 1016, 1048, and 1052 are partition type having a size ofN×2N, and the prediction unit 1032 is partition type having a size ofN×N. Prediction units and partitions of the coding units 1010 aresmaller than or equal to each coding unit.

Transformation or inverse transformation is performed on image data ofthe coding units 1052 and 1054 in the transformation units 1070 in adata unit that is smaller than the coding units 1052 and 1054. Also, thetransformation units 1014, 1016, 1022, 1032, 1048, 1050, and 1052 in thetransformation units 1070 are different from those in the predictionunits 1060 in terms of sizes and shapes. In other words, the videoencoding and decoding apparatuses 100 and 200 may perform intraprediction, motion estimation, motion compensation, transformation, andinverse transformation individually on a data unit in the same codingunit.

FIG. 11 is a table showing encoding information regarding each codingunit according to an exemplary embodiment.

The encoding information encoder 140 of the video encoding apparatus 100illustrated in FIG. 1 may encode the encoding information regarding eachcoding unit, and the encoding information extractor 220 of the videodecoding apparatus 200 illustrated in FIG. 2 may extract the encodinginformation regarding each coding unit.

The encoding information may contain split information regarding eachcoding unit, information regarding a partition type of each coding unit(hereinafter, referred to as “partition type information”), a predictionmode, and the size of a transformation unit. The encoding informationillustrated in FIG. 11 is just an example of encoding information thatthe video encoding apparatus 100 and the video decoding apparatus 200may set, and thus, the inventive concept is not limited thereto.

The split information may indicate a coding depth of a correspondingcoding unit. That is, since the coding depth is a depth that cannot besplit according to the split information, partition type information, aprediction mode, and a size of a transformation unit may be defined withrespect to the coding depth. When a current depth is split once moreaccording to the split information, encoding may be individuallyperformed on four coding units corresponding to upper depths.

In the split type information, the split type of a transformation unitof the coding unit having the coding depth, may be represented as one of2N×2N, 2N×N, N×2N, and N×N. In the prediction mode, a motion estimationmode may be represented as one of an intra mode, an inter mode, and askip mode. The intra mode may be defined only when a partition typeincludes 2N×2N and N×N. The skip mode may be defined only when apartition type includes 2N×2N. The size of the transformation unit maybe set in such a manner that two sizes are set in the intra mode, andtwo sizes are set in the inter mode.

Each minimum coding unit included in a coding unit may contain encodinginformation regarding each coding unit corresponding to a coding depththereof. Thus, it is possible to determine whether a current coding unitis one of coding units belonging to the same coding depth by checkingencoding information of adjacent minimum coding units. Also, codingunits corresponding to a current coding depth may be checked by usingencoding information of a minimum coding unit. Accordingly, adistribution of coding depths in a maximum coding unit may be derived.

Intra prediction that is performed by the intra predictor 410 of thevideo encoding apparatus 100 of FIG. 1 and the intra predictor 550 ofthe video decoding apparatus of FIG. 2 according to exemplaryembodiments, will now be described in detail. In the followingdescriptions, it should be understood that the term, ‘coding unit’ isrelated to an encoding process of an image and is referred to as a‘decoding unit’ related to a decoding process of an image. That is, inthe following descriptions, the terms, ‘the coding unit’ and ‘thedecoding unit’ indicate the same thing and are different only in thatwhether the encoding process or the decoding process is performed. Forthe consistency of terms, except for a particular case, the coding unitand the decoding unit may be referred to as a coding unit in both theencoding and decoding processes.

FIG. 12 is a block diagram of an intra prediction apparatus 1200according to an exemplary embodiment. Referring to FIG. 12, the intraprediction apparatus 1200 includes a predictor 1210 and a post-processor1220. The predictor 1210 intra predicts a current coding unit by usingintra prediction modes determined according to the size of the currentcoding unit, and outputs a first predicted coding unit. Thepost-processor 1220 performs post-processing by using neighboring pixelsof pixels that constitute the first predicted coding unit so as tochange the values of the pixels of the first predicted coding unit, andthen outputs a second predicted coding unit that is post-processed.

FIG. 13 is a table showing a number of intra prediction modes accordingto the size of a coding unit, according to an exemplary embodiment.According to an exemplary embodiment, a number of intra prediction modesmay be determined according to the size of a coding unit (a decodingunit in the case of a decoding process). Referring to FIG. 13, if thesize of a coding unit that is to be intra predicted is, for example,N×N, then numbers of intra prediction modes that are to be actuallyperformed on coding units having sizes of 2×2, 4×4, 8×8, 16×16, 32×32,64×64, and 128×128 may be 5, 9, 9, 17, 33, 5, and 5, respectively(Example 2). The reason why a number of intra prediction modes that areto be actually performed is determined according to the size of a codingunit, is because overhead for encoding prediction mode informationvaries according to the size of the coding unit. In other words,although a small-sized coding unit occupies a small area in an entireimage, overhead for transmitting additional information, e.g., aprediction mode, regarding the small-sized coding unit may be large.Thus, when a small-sized coding unit is encoded using too manyprediction modes, a number of bits may increase, thus degradingcompression efficiency. A large-sized coding unit, e.g., a coding unithaving a size of 64×64 or more, is highly likely to be selected as acoding unit for a flat region of an image. Compression efficiency mayalso be degraded when a large-sized coding unit selected to encode sucha flat region is encoded using too many prediction modes.

Thus, according to an exemplary embodiment, coding unit size may belargely classified into at least three sizes: N1×N1 (2≦N1≦8, N1 denotesan integer), N2×N2 (16≦N2≦32, N2 denotes an integer), and N3×N3 (64≦N3,N3 denotes an integer). If a number of intra prediction modes that areto be performed on each coding unit having a size of N1×N1 is A1 (A1denotes a positive integer), a number of intra prediction modes that areto be performed on each coding unit having a size of N2×N2 is A2 (A2denotes a positive integer), and a number of intra prediction modes thatare to be performed on each coding unit having a size of N3×N3 is A3 (A3denotes a positive integer), then a number of intra prediction modesthat are to be performed according to the size of a coding unit, may bedetermined to satisfy ‘A3≦A1≦A2’. That is, if a current picture isdivided into a small-sized coding unit, a medium-sized coding unit, anda large-sized coding unit, then a number of prediction modes that are tobe performed on the medium-sized coding unit may be greater than thoseof prediction modes to be performed on the small-sized coding unit andthe large-sized coding unit. However, the exemplary embodiments are notlimited thereto and a large number of prediction modes may also be setto be performed on the small-sized and medium-sized coding units. Thenumbers of prediction modes according to the size of each coding unitillustrated in FIG. 13 is just an example and may thus be variable.

FIGS. 14A to 14C are drawings for explaining intra prediction modes thatmay be performed on a coding unit having a predetermined size, accordingto exemplary embodiments. Specifically, FIG. 14A is a table showingintra prediction modes that may be performed on a coding unit having apredetermined size, according to an exemplary embodiment. Referring toFIGS. 13 and 14A, for example, if a coding unit having a size of 4×4 isintra predicted, a vertical mode (mode 0), a horizontal mode (mode 1), adirect-current (DC) mode (mode 2), a diagonal down-left mode (mode 3), adiagonal down-right mode (mode 4), a vertical-right mode (mode 5), ahorizontal-down mode (mode 6), a vertical-left mode (mode 7), or ahorizontal-up mode (mode 8) may be performed.

FIG. 14B illustrate directions of the intra prediction modes illustratedin FIG. 14A, according to an exemplary embodiment. In FIG. 14B, valuesassigned to arrows denote mode values when prediction is performed indirections indicated with the arrows, respectively. Here, mode 2 is a DCprediction mode having no direction and is thus not illustrated in FIG.14B.

FIG. 14C illustrate intra prediction methods that may be performed onthe coding unit illustrated in FIG. 14A, according to an exemplaryembodiment. Referring to FIG. 14C, a predicted coding unit is producedusing neighboring pixels A to M of a current coding unit according to anavailable intra prediction mode determined according to the size of thecurrent coding unit. For example, a method of prediction encoding acurrent coding unit having a size of 4×4 according to the vertical mode(mode 0) of FIG. 14A, will be described. First, values of the pixels Ato D adjacent to the top of the 4×4 coding unit are predicted as valuesof the 4×4 coding unit. Specifically, the values of the pixel A arepredicted as four values of pixels at a first column of the 4×4 codingunit, the values of the pixel B are predicted as four values of pixelsat a second column of the 4×4 coding unit, the values of the pixel C arepredicted as four values of pixels at a third column of the 4×4 codingunit, and the values of the pixel D are predicted as four values ofpixels at a fourth column of the 4×4 current coding unit. Then, errorvalues between actual values of pixels included in a predicted 4×4coding unit predicted using the pixels A to D and the original 4×4coding unit are calculated and encoded.

FIG. 15 is drawings for explaining intra prediction modes that may beperformed on a coding unit having a predetermined size, according toother exemplary embodiments. Referring to FIGS. 13 and 15, for example,if a coding unit having a size of 2×2 is intra predicted, a total offive modes, e.g., a vertical mode, a horizontal mode, a DC mode, a planemode, and a diagonal down-right mode, may be performed.

As illustrated in FIG. 13, if a coding unit having a size of 32×32 has33 intra prediction modes, then directions of the 33 intra predictionmodes should be set. According to an exemplary embodiment, a predictiondirection for selecting neighboring pixels to be used as referencepixels based on pixels included in a coding unit, is set by using a ‘dx’parameter and a ‘dy’ parameter so as to set intra prediction modeshaving various directionalities in addition to the intra predictionmodes described above with reference to FIGS. 14A-C and 15. For example,when each of the 33 prediction modes is defined as mode N (N is aninteger from 0 to 32), mode 0, mode 1, mode 2, and mode 3 are set as avertical mode, a horizontal mode, a DC mode, and a plane mode,respectively, and each of mode 4 to mode 31 may be set as a predictionmode having a directionality of tan⁻¹(dy/dx) by using a (dx, dy)parameter expressed with one from among (1,−1), (1,1), (1,2), (2,1),(1,−2), (2,1), (1,−2), (2,−1), (2,−11), (5,−7), (10,−7), (11,3), (4,3),(1,11), (1,−1), (12,−3), (1,−11), (1,−7), (3,−10), (5,−6), (7,−6),(7,−4), (11,1), (6,1), (8,3), (5,3), (5,7), (2,7), (5,−7), and (4,−3)shown in Table 1.

TABLE 1 mode # dx dy mode 4 1 −1 mode 5 1 1 mode 6 1 2 mode 7 2 1 mode 81 −2 mode 9 2 −1 mode 10 2 −11 mode 11 5 −7 mode 12 10 −7 mode 13 11 3mode 14 4 3 mode 15 1 11 mode 16 1 −1 mode 17 12 −3 mode 18 1 −11 mode19 1 −7 mode 20 3 −10 mode 21 5 −6 mode 22 7 −6 mode 23 7 −4 mode 24 111 mode 25 6 1 mode 26 8 3 mode 27 5 3 mode 28 5 7 mode 29 2 7 mode 30 5−7 mode 31 4 −3 Mode 0, mode 1, mode 2, mode 3, and mode 32 denote avertical mode, a horizontal mode, a DC mode, a plane mode, and aBi-linear mode, respectively.

Mode 32 may be set as a bi-linear mode that uses bi-linear interpolationas will be described later with reference to FIG. 17.

FIG. 16 is a reference diagram for explaining inter prediction modeshaving various directionalities according to exemplary embodiments. Asdescribed above with reference to Table 1, each of intra predictionmodes according to exemplary embodiments may have directionality oftan⁻¹(dy/dx) by using a plurality of (dx, dy) parameters.

Referring to FIG. 16, neighboring pixels A and B on a line 160 thatextends from a current pixel P in a current coding unit, which is to bepredicted, at an angle of tan⁻¹(dy/dx) determined by a value of a (dx,dy) parameter according to a mode, shown in Table 1, may be used aspredictors of the current pixel P. In this case, the neighboring pixelsA and B may be pixels that have been previously encoded and restored,and belong to previous coding units located above and to the left sideof the current coding unit. Also, when the line 160 does not pass alongneighboring pixels on locations each having an integral value but passesbetween these neighboring pixels, neighboring pixels closer to the line160 may be used as predictors of the current pixel P. If two pixels thatmeet the line 160, e.g., the neighboring pixel A located above thecurrent pixel P and the neighboring pixel B located to the left side ofthe current pixel P, are present, an average of values of theneighboring pixels A and B may be used as a predictor of the currentpixel P. Otherwise, if a product of values of the ‘dx’ and ‘dy’parameters is a positive value, the neighboring pixel A may be used, andif the product of the values of the ‘dx’ and ‘dy’ parameters is anegative value, the neighboring pixel B may be used.

The intra prediction modes having various directionalities shown inTable 1 may be predetermined by an encoding side and a decoding side,and only an index of an intra prediction mode of each coding unit may betransmitted.

FIG. 17 is a reference diagram for explaining a bi-linear mode accordingto an exemplary embodiment. Referring to FIG. 17, in the bi-linear mode,a geometric average is calculated by considering a value of a currentpixel P 170 in a current coding unit, which is to be predicted, valuesof pixels on upper, lower, left, and right boundaries of the currentcoding unit, and the distances between the current pixel P 170 and theupper, lower, left, and right boundaries of the current coding unit, andis then used as a predictor of the current pixel P 170. For example, inthe bi-linear mode, a geometric average calculated using a virtual pixelA 171, a virtual pixel B 172, a pixel D 176, and a pixel E 177 locatedto the upper, lower, left, and right sides of the current pixel P 170,and the distances between the current pixel P 170 and the upper, lower,left, and right boundaries of the current coding unit, is used as apredictor of the current pixel P 170. Since the bi-linear mode is one ofintra prediction modes, neighboring pixels that have been previouslyencoded and restored and belong to previous coding units are used asreference pixels for prediction. Thus, values in the current coding unitare not used as pixel A 171 and pixel B 172 but virtual valuescalculated using neighboring pixels located to the upper and left sidesof the current coding unit are used as the pixel A 171 and the pixel B172.

Specifically, first, a value of a virtual pixel C 173 on a lowerrightmost point of the current coding unit is calculated by calculatingan average of values of a neighboring pixel (right-up pixel) 174 on anupper rightmost point of the current coding unit and a neighboring pixel(left-down pixel) 175 on a lower leftmost point of the current codingunit, as expressed in the following equation:

C=0.5(LeftDownPixel+RightUpPixel)  (1)

Next, a value of the virtual pixel A 171 located on a lowermost boundaryof the current coding unit when the current pixel P 170 is extendeddownward by considering the distance W1 between the current pixel P 170and the left boundary of the current coding unit and the distance W2between the current pixel P 170 and the right boundary of the currentcoding unit, is calculated by using the following equation:

A=(C*W1+LeftDownPixel*W2)/(W+W2)  (2)

Similarly, a value of the virtual pixel B 172 located on a rightmostboundary of the current coding unit when the current pixel P 170 isextended in the right direction by considering the distance h1 betweenthe current pixel P 170 and the upper boundary of the current codingunit and the distance h2 between the current pixel P 170 and the lowerboundary of the current coding unit, is calculated by using thefollowing equation:

B=(C*h1+RightUpPixel*h2)/(h1+h2)  (3)

When the values of the virtual pixels A and B are determined usingEquations (1) to (3), an average of the values of the pixels A 171, thepixel B 172, the pixel D 176, and the pixel E 177 may be used as apredictor of the current pixel P 170. As descried above, in thebi-linear mode, a predicted coding unit of the current coding unit maybe obtained by performing bi-linear prediction on all pixels included inthe current coding unit.

According to an exemplary embodiment, prediction encoding is performedaccording to one of various intra prediction modes determined accordingto the size of a coding unit, thereby allowing efficient videocompression based on characteristics of an image.

As described above, a predicted coding unit produced using an intraprediction mode determined according to the size of a current codingunit by the predictor 1210 of the intra prediction apparatus 1200 ofFIG. 12, has directionality according to the intra prediction mode. Thedirectionality in the predicted coding unit may lead to an improvementin prediction efficiency when pixels of the current coding unit that isto be predicted have a predetermined directionality but may lead to adegradation in prediction efficiency when these pixels do not have apredetermined directionality. Thus, the post-processor 1220 may improveprediction efficiency by producing a new predicted coding unit bychanging values of pixels in the predicted coding unit by using thepixels in the predicted coding unit and at least one neighboring pixel,as post-processing for the predicted coding unit produced through intraprediction.

A method of post-processing a predicted coding unit by thepost-processor 1220 of FIG. 12, will now be described.

The post-processor 1220 produces a second predicted coding unit bychanging values of pixels constituting a first predicted coding unitproduced by the predictor 1210 by performing an operation by using thepixels of the first predicted coding unit and at least one neighboringpixel. Here, the predictor 1220 produces the first predicted coding unitby using an intra prediction mode determined according to a size of acurrent coding unit, as described above.

FIG. 18 is a reference diagram for explaining post-processing of a firstpredicted coding unit, according to an exemplary embodiment. In FIG. 18,reference numerals 1810 to 1860 illustrate a process of changing valuesof pixels in the first predicted coding unit by the post-processor 1220in chronological order.

Referring to FIG. 18, the post-processor 1220 changes values of pixelsin the first predicted coding unit 1810 by calculating a weightedaverage of values of a pixel in the first predicted coding unit 1810,which is to be changed, and neighboring pixels of the pixel. Forexample, referring to FIG. 18, if a value of a pixel 1821 of the firstpredicted coding unit 1810, which is to be changed, is f[1][1], a valueof a pixel 2022 located above the pixel 1821 is f[0][1], a pixel 1823located to the left side of the pixel 1821 is f[1][0], and a result ofchanging the value f[1][1] of the pixel 1821 is f′[1][1], then f′[1][1]may be calculated using the following equation:

$\begin{matrix}{{{f^{\prime}\lbrack 1\rbrack}\lbrack 1\rbrack} = \frac{{{f\lbrack 0\rbrack}\lbrack 1\rbrack} + {{f\lbrack 1\rbrack}\lbrack 0\rbrack} + {2*{{f\lbrack 1\rbrack}\lbrack 1\rbrack}}}{4}} & (1)\end{matrix}$

As illustrated in FIG. 18, the post-processor 1220 changes values ofpixels included in the first predicted coding unit 1810 by calculating aweighted average of the values of each of the pixel of the firstpredicted coding unit and pixels located above and to the left side ofthe pixel in a direction from an upper leftmost point of the firstpredicted coding unit to a lower rightmost point of the first predictedcoding unit. However, such a post-processing operation according to theexemplary embodiments are not limited thereto, and may be sequentiallyperformed on the pixels of the first predicted coding unit in adirection from a upper rightmost point of the first predicted codingunit to a lower leftmost point of the first predicted coding unit or adirection from the lower rightmost point of the first predicted codingunit to the upper leftmost point of the first predicted coding unit. Forexample, if the post-processor 1220 changes the values of the pixels ofthe first predicted coding unit in the direction from the upperrightmost point to the lower leftmost point unlike as illustrated inFIG. 18, then the values of the pixels of the first predicted codingunit are changed by calculating a weighted average of the values of eachof the pixels of the first predicted coding unit and pixels locatedbelow and to the right side of the first predicted coding unit.

FIGS. 19 and 20 are reference diagrams for explaining an operation ofthe post-processor 1220 of FIG. 12 according to exemplary embodiments.In FIG. 19, reference numeral 1910 denotes a first pixel of a firstpredicted coding unit 1900, which is to be changed, and referencenumerals 1911 to 1918 denote neighboring pixels of the first pixel 1910.

In the current exemplary embodiment (first exemplary embodiment) of FIG.19, neighboring pixels of the first pixel 1910 are not limited to thoselocated above and to the left side of the first predicted coding unit,unlike as illustrated in FIG. 18. Referring to FIG. 19, thepost-processor 1220 may post-process the first pixel 1910 by using apredetermined number of neighboring pixels selected from among theneighboring pixels 1911 to 1918. That is, referring to FIG. 20, apredetermined number of pixels are selected from among neighboringpixels P1 to P8 of a first pixel c of a current coding unit, and a valueof the first pixel c is changed by performing a predetermined operationon the selected neighboring pixels and the first pixel c. For example,if the size of the first predicted coding unit 1900 is m×n, a value ofthe first pixel 1910, which is to be changed and is located at an i^(th)column and a j^(th) row of the first predicted coding unit 1900, isf[i][j], values of n pixels selected from among the neighboring pixels1911 to 1918 of the first pixel 1910 so as to post-process the firstpixel 1910 are fl to fn, respectively, then the post-processor 1220changes the value of the first pixel 1910 from f[i][j] to f′[i][j] byusing the following equation. Here, m denotes a positive integer, n is‘2’ or ‘3’, i denotes an integer from 0 to m−1, and j denotes an integerfrom 0 to n−1.

$\begin{matrix}{{{{f^{\prime}\lbrack i\rbrack}\lbrack j\rbrack} = {\frac{{f\; 1} + {f\; 2} + {2x\; {{f\lbrack i\rbrack}\lbrack j\rbrack}}}{4}\mspace{14mu} \left( {n = 2} \right)}}{{{f^{\prime}\lbrack i\rbrack}\lbrack j\rbrack} = {\frac{{f\; 1} + {f\; 2} + {f\; 3} + {{f\lbrack i\rbrack}\lbrack j\rbrack}}{4}\mspace{14mu} \left( {n = 3} \right)}}} & (2)\end{matrix}$

The post-processor 1220 produces a second predicted coding unit bychanging values of all pixels included in the first predicted codingunit 1900 by using Equation (2). In Equation (2), three neighboringpixels are used, but the exemplary embodiments are not limited theretoand the post-processor 1220 may perform post-processing by using four ormore neighboring pixels.

According to a second exemplary embodiment, the post-processor 1220produces a second predicted coding unit by changing the value of eachpixel of the first predicted coding unit 1900 by using a weightedharmonic average of the values of a pixel of the first predicted codingunit 1900, which is to be changed, and neighboring pixels of the pixel.

For example, the post-processor 1220 changes the value of a pixel at thei^(th) column and the j^(th) row of the first predicted coding unit 1900from f[i][j] to f′[i][j] by using neighboring pixels located above andto the left side of the pixel, as shown in the following equation:

$\begin{matrix}{{{{f^{\prime}\lbrack i\rbrack}\lbrack j\rbrack} = \frac{\alpha + \beta + \gamma}{\frac{\alpha}{{f\left\lbrack {i - 1} \right\rbrack}\lbrack j\rbrack} + \frac{\beta}{{f\lbrack i\rbrack}\left\lbrack {j - 1} \right\rbrack} + \frac{\gamma}{{f\lbrack i\rbrack}\lbrack j\rbrack}}},} & (3)\end{matrix}$

wherein α, β, and γ denote positive integers, and for example, α=2, β=2,and γ=1.

According to a third exemplary embodiment, the post-processor 1220produces a second predicted coding unit by changing the value of eachpixel of the first predicted coding unit 1900 by using a weightedgeometric average of values of a pixel of the first predicted codingunit 1900, which is to be changed, and neighboring pixels of the pixel.

For example, the post-processor 1220 changes the value of a pixel at thei^(th) column and the j^(th) row of the first predicted coding unit 1900from f[i][j] to f′[i][j] by using neighboring pixels located above andto the left side of the pixel, as shown in the following equation:

$\begin{matrix}{{{{f^{\prime}\lbrack i\rbrack}\lbrack j\rbrack} = \left( {{{f\left\lbrack {i - 1} \right\rbrack}\lbrack j\rbrack}^{\alpha}*{{f\lbrack i\rbrack}\left\lbrack {j - 1} \right\rbrack}^{\beta}*{{f\lbrack i\rbrack}\lbrack j\rbrack}^{\gamma}} \right)^{\frac{1}{({\alpha + \beta + \gamma})}}},} & (4)\end{matrix}$

wherein α, β, and γ denote positive integers, and for example, α=1, β=1,and γ=2. In Equation (2) to (4), a relative large weight is assigned tothe value f[i][j] of the pixel that is to be changed.

As described above, in the first to third exemplary embodiments, thepost-processor 1220 may perform post-processing by using not onlyneighboring pixels located above and to the left side of a pixel that isto be changed, but also a predetermined number of neighboring pixelsselected from among the neighboring pixels 1911 to 1918 as illustratedin FIG. 19.

According to a fourth exemplary embodiment, the post-processor 1220produces a second predicted coding unit by changing the value of eachpixel in the first predicted coding unit by using an average of thevalues of a pixel in the first predicted coding unit, which is to bechanged, and one selected from among neighboring pixels of the pixel.

For example, the post-processor 1220 changes the value of a pixel at thei^(th) column and the j^(th) row of the first predicted coding unit 1900from f[i][j] to f′[i][j] by using neighboring pixels located above thepixel, as shown in the following equation:

$\begin{matrix}{{{f^{\prime}\lbrack i\rbrack}\lbrack j\rbrack} = \frac{{{f\left\lbrack {i - 1} \right\rbrack}\lbrack j\rbrack} + {{f\lbrack i\rbrack}\lbrack j\rbrack}}{2}} & (5)\end{matrix}$

Similarly, according to a fifth exemplary embodiment, the post-processor1220 produces a second predicted coding unit by changing the value ofeach pixel in the first predicted coding unit by using an average of thevalues of a pixel in the first predicted coding unit, which is to bechanged, and neighboring pixels located to the left side of the pixel.

In other words, the post-processor 1220 changes the value of a pixel atthe i^(th) column and the j^(th) row of the first predicted coding unit1900 from f[i][j] to f′[i][j], as shown in the following equation:

$\begin{matrix}{{{f^{\prime}\lbrack i\rbrack}\lbrack j\rbrack} = \frac{{{f\lbrack i\rbrack}\left\lbrack {j - 1} \right\rbrack} + {{f\lbrack i\rbrack}\lbrack j\rbrack}}{2}} & (6)\end{matrix}$

According to a sixth exemplary embodiment, the post-processor 1220produces a second predicted coding unit by changing the value of eachpixel in the first predicted coding unit by using a median between thevalues of a pixel of the first predicted coding unit, which is to bechanged, and neighboring pixels of the pixel. Referring back to FIG. 19,for example, it is assumed that the value f[i][j] of the first pixel1910 at the i^(th) column and the j^(th) row of the first predictedcoding unit 1900, the value f[i][j−1] of the second pixel 1912, and thevalue f[i−1][j] of the third pixel 1911 have a relation off[i][j−1]>f[i−1][j]>f[i][j]. In this case, the post-processor 1220changes the value f[i][j] of the first pixel 1910 to the medianf[i−1][j] among the first to third pixels 1910 to 1912.

In seventh to ninth exemplary embodiments, the post-processor 1220produces a second predicted coding unit by using previous coding unitsadjacent to a current coding unit, which have been previously encodedand restored, rather than by using neighboring pixels of a pixel that isto be changed.

Referring back to FIG. 19, in the seventh exemplary embodiment, thepost-processor 1220 changes the value of the first pixel 1910 tof′[i][j] by calculating an average of the value of the first pixel 1910at the i^(th) column and the j^(th) row of the first predicted codingunit 1900 and the value of the pixel 1921 that is located at the samecolumn as the first pixel 1910 and included in a coding unit adjacent tothe top of the current coding unit, as shown in the following equation:

$\begin{matrix}{{{{f^{\prime}\lbrack i\rbrack}\lbrack j\rbrack} = \frac{{{f\lbrack i\rbrack}\lbrack j\rbrack} + {{f\left\lbrack {- 1} \right\rbrack}\lbrack j\rbrack}}{2}},} & (7)\end{matrix}$

wherein f[−1][j] denotes the value of the pixel 1921.

Similarly, in the eighth exemplary embodiment, the post-processor 1220changes the value of the first pixel 1910 to f′[i][j] by calculating anaverage of the value of the first pixel 1910 at the i^(th) column andthe j^(th) row of the first predicted coding unit 1900 and the value ofthe pixel 1922 that is located at the same row as the first pixel 1910and included in a coding unit adjacent to the left side of the currentcoding unit, as shown in the following equation:

$\begin{matrix}{{{{f^{\prime}\lbrack i\rbrack}\lbrack j\rbrack} = \frac{{{f\lbrack i\rbrack}\lbrack j\rbrack} + {{f\lbrack i\rbrack}\left\lbrack {- 1} \right\rbrack}}{2}},} & (8)\end{matrix}$

wherein f[i][−1] denotes the value of the pixel 1922.

In the ninth exemplary embodiment, the post-processor 1220 changes thevalue of the first pixel 1910 to f′[i][j] by calculating a weightedaverage of the values of the first pixel 1910 at the i^(th) column andthe j^(th) row of the first predicted coding unit 1900, the pixel 1921located at the same column as the first pixel 1910 and included in acoding unit adjacent to the top of the current coding unit, and thepixel 1922 located at the same row as the first pixel 1910 and includedin a coding unit adjacent to the left side of the current coding unit,as shown in the following equation:

$\begin{matrix}{{{f^{\prime}\lbrack i\rbrack}\lbrack j\rbrack} = \frac{{2{{f\lbrack i\rbrack}\lbrack j\rbrack}} + {{f\left\lbrack {- 1} \right\rbrack}\lbrack j\rbrack} + {{f\lbrack i\rbrack}\left\lbrack {j - 1} \right\rbrack}}{4}} & (9)\end{matrix}$

In a tenth exemplary embodiment, the post-processor 1220 changes thevalue of the first pixel 1910 of the first predicted coding unit 1900,which is to be changed, from f[i][j] to f′[i][j] by using one of thefollowing equations.

f′[i][j]=min(f[i][j]+i,255)  (10)

f′[i][j]=min(f[i][j]+j,255)  (11)

f′[i][j]=max(f[i][j]−i,0)  (12)

f′[i][j]=max(f[i][j]−j,0)  (13)

In Equation (10), the values of the first predicted coding unit 1900 arechanged to gradually increase from top to bottom, in column units of thefirst predicted coding unit 1900. In Equation (11), the values of thefirst predicted coding unit 1900 are changed to gradually increase in aright direction, in row units of the first predicted coding unit 1900.In Equation (12), the values of the first predicted coding unit 1900 arechanged to gradually decrease from top to bottom, in column units of thefirst predicted coding unit 1900. In Equation (13), the values of thefirst predicted coding unit 1900 are changed to gradually decrease inthe right direction, in row units of the first predicted coding unit1900.

In an eleventh exemplary embodiment, if the value of the first pixel1910, which is located at the ith column and the jth row of the firstpredicted coding unit 1900 and is to be changed, is f[i][j], the valueof a pixel located at an upper leftmost point of the first predictedcoding unit 1900 is f[0][0], the value of a pixel located at the jth rowas the first pixel 1910 and at the leftmost point of the first predictedcoding unit 1900 is f[0][j], the value of a pixel located at the ithcolumn as the first pixel 1910 and at the uppermost point of the firstpredicted coding unit is f[i][0], and G[i][j]=f[i][0]+f[0][j]−f[0][0],then the post-processor 1220 changes the value of the first pixel 1910to f′[i][j], as shown in the following equation:

f′[i][j]=(f[i][j]+G[i][j])/2  (14)

Equation (14) is based on a wave equation, in which the value of eachpixel in the first predicted coding unit 1900 is changed by calculatingthe value G[i][j] by setting the values of a pixel on the uppermost rowof and a pixel on the leftmost column of the first predicted coding unit1900 to be boundary conditions so as to smooth the value of each pixelin the first predicted coding unit 1900, and then calculating an averageof the values G[i][j] and f[i][j].

Costs of bitstreams containing results of encoding second predictedcoding units produced using various operation modes according to theabove first through eleventh exemplary embodiments, respectively, arecompared to one another. Then, the operation mode having the minimumcost is added to a header of a bitstream from among the variousoperation modes. When the operation mode is added to the bistream, it ispossible to represent different operation modes to be differentiatedfrom one another by using variable-length coding, in which a smallnumber of bits are assigned to an operation mode that is most frequentlyused, based on a distribution of the operation mode determined afterencoding of a predetermined number of coding units is completed. Forexample, if an operation mode according to the first exemplaryembodiment is an optimum operation leading to the minimum cost of mostcoding units, a minimum number of bits are assigned to an indexindicating this operation mode so that this operation mode may bedifferentiated from the other operation modes.

When a coding unit is split to sub coding units and prediction isperformed in the sub coding units, a second predicted coding unit may beproduced by applying different operation modes to the sub coding units,respectively, or by applying the same operation mode to sub coding unitsbelonging to the same coding unit so as to simplify calculation anddecrease an overhead rate.

A rate-distortion optimization method may be used as a cost fordetermining an optimum operation mode. Since a video encoding methodaccording to an exemplary embodiment is performed on an intra predictedcoding unit used as reference data for another coding unit, a cost maybe calculated by allocating a high weight to a distortion, compared tothe rate-distortion optimization method. That is, in the rate-distortionoptimization method, a cost is calculated, based on a distortion that isthe difference between an encoded image and the original image and abitrate generated, as shown in the following equation:

Cost=distortion+bit-rate  (15)

In contrast, in a video encoding method according to an exemplaryembodiment, an optimum post-processing mode is determined by allocatinga high weight to a distortion, compared to the rate-distortionoptimization method, as shown in the following equation:

Cost=α*distortion+bit-rate (α denotes a real number equal to or greaterthan ‘2’)  (16)

FIG. 21 is a flowchart illustrating a method of encoding video accordingto an exemplary embodiment. Referring to FIG. 21, in operation 2110, afirst predicted coding unit of a current coding unit that is to beencoded, is produced. The first predicted coding unit is an intrapredicted block produced by performing a general intra predictionmethod, and one of various intra prediction modes having variousdirectionalities, which is determined by the size of a coding unit.

In operation 2120, a second predicted coding unit is produced bychanging a value of each pixel of the first predicted coding unit byusing each pixel of the first predicted coding unit and at least oneneighboring pixel. As described above in the first through eleventhexemplary embodiments regarding an operation of the post-processor 1220,the second predicted coding unit may be produced by changing the valueof each pixel in the first predicted coding unit by performing one ofvarious operation modes on a pixel of the first predicted coding unit,which is to be changed, and neighboring pixels thereof.

In operation 2130, a residual block that is the difference between thecurrent coding unit and the second predicted coding unit, istransformed, quantized, and entropy encoded so as to generate abitstream. Information regarding the operation mode used to produce thesecond predicted coding unit may be added to a predetermined region ofthe generated bitstream, so that a decoding apparatus may reproduce thesecond predicted coding unit of the current coding unit.

FIG. 22 is a flowchart illustrating a method of decoding video accordingto an exemplary embodiment. Referring to FIG. 22, in operation 2210,information regarding a prediction mode related to a current decodingunit that is to be decoded, is extracted from a received bitstream.

In operation 2220, a first predicted decoding unit of the currentdecoding unit is reproduced according to the extracted information.

In operation 2230, information regarding an operation mode in which eachpixel of the first predicted decoding unit and neighboring pixels ofeach pixel are used, is extracted from the bitstream.

In operation 2240, a second predicted decoding unit is reproduced bychanging a value of each pixel of the first predicted decoding unit byusing each pixel of the first predicted decoding unit and neighboringpixels thereof, based on the information regarding the operation mode.

In operation 2250, a residual block that is the difference between thecurrent decoding unit and the second predicted decoding unit isextracted from the bitstream, and is reconstructed.

In operation 2260, the residual block and the second predicted decodingunit are combined to decode the current decoding unit.

The present invention can also be embodied as computer readable code ona computer readable recording medium. The computer readable recordingmedium is any data storage device that can store data which can bethereafter read by a computer system. Examples of the computer readablerecording medium include read-only memory (ROM), random-access memory(RAM), CD-ROMs, magnetic tapes, floppy disks, and optical data storagedevices. The computer readable recording medium can also be distributedover network coupled computer systems so that the computer readable codeis stored and executed in a distributed fashion.

While the present invention has been particularly shown and describedwith reference to exemplary embodiments thereof, it will be understoodby one of ordinary skill in the art that various changes in form anddetails may be made therein without departing from the spirit and scopeof the invention as defined by the following claims. The exemplaryembodiments should be considered in a descriptive sense only and not forpurposes of limitation. Therefore, the scope of the invention is definednot by the detailed description of the invention but by the followingclaims, and all differences within the scope will be construed as beingincluded in the present invention.

1. A method of encoding video, the method comprising: producing a firstpredicted coding unit of a current coding unit that is to be encoded;producing a second predicted coding unit by changing a value of each oneof pixels of the first predicted coding unit by using the each one ofpixels of the first predicted coding unit and at least one neighboringpixel of the each one of pixels of the first predicted coding unit; andencoding differences between the current coding unit and the secondpredicted coding unit.
 2. The method of claim 1, wherein the producingof the first predicted coding unit comprises: splitting a currentpicture into at least one coding unit, based on a maximum coding unitand a depth that is hierarchical split information regarding the maximumcoding unit; and producing the first predicted coding unit by performingintra prediction on the at least one coding unit.
 3. The method of claim1, wherein the producing of the second predicted coding unit compriseschanging the value of each one of pixels of the first predicted codingunit by calculating a weighted average of values of at least oneneighboring pixel of the each one of pixels of the first predictedcoding unit and the each one of the pixels of the first predicted codingunit.
 4. The method of claim 3, wherein, if a size of the firstpredicted coding unit is m×n, a value of a first pixel, which is to bechanged and is located at an i^(th) column and a j^(th) row of the firstpredicted coding unit, is f[i][j], and values of two neighboring pixelsselected from among neighboring pixels f[i][j−1], f[i−1][j], f[i+1][j],f[i][j+1], f[i−1][j+1], f[i+1][j−1], f[i−1][j−1], and f[i+1][j+1] of thefirst pixel are f1 and f2, respectively, then the producing of thesecond predicted coding unit further comprises changing the value of thefirst pixel to f′[i][j] by using a following equation:${{{f^{\prime}\lbrack i\rbrack}\lbrack j\rbrack} = \frac{{f\; 1} + {f\; 2} + {2*{{f\lbrack i\rbrack}\lbrack j\rbrack}}}{4}},$wherein m and n denote positive integers.
 5. The method of claim 3,wherein, if a size of the first predicted coding unit is m×n, a value ofa first pixel, which is to be changed and is located at an i^(th) columnand a j^(th) row of the first predicted coding unit, is f[i][j], andvalues of three neighboring pixels selected from among neighboringpixels f[i][j−1], f[i−1][j], f[i+1][j], f[i][j+1], f[i−1][j+1],f[i+1][j−1], f[i−1][j−1], and f[i+1][j+1] of the first pixel are f1, f2,and f3, respectively, then the producing of the second predicted codingunit further comprises changing the value of the first pixel to f[i][j]by using a following equation:${{{f^{\prime}\lbrack i\rbrack}\lbrack j\rbrack} = \frac{{f\; 1} + {f\; 2} + {f\; 3} + {{f\lbrack i\rbrack}\lbrack j\rbrack}}{4}},$wherein m and n denote positive integers.
 6. The method of claim 1,wherein the producing of the second predicted coding unit compriseschanging the value of each one of pixels of the first predicted codingunit to a weighted harmonic average of values of at least oneneighboring pixel of the each one of pixels of the first predictedcoding unit and the each one of pixels of the first predicted codingunit.
 7. The method of claim 6, wherein, if a size of the firstpredicted coding unit is m×n, a value of a first pixel, which is to bechanged and is located at an i^(th) and a j^(th) row of the firstpredicted coding unit, is f[i][j], a value of a second pixel located tothe left of the first pixel is f[i][j−1], and a value of a third pixellocated above the first pixel is f[i−1][j], then the producing of thesecond predicted coding unit further comprises changing the value of thefirst pixel to f′[i][j] by using a following equation:${{{f^{\prime}\lbrack i\rbrack}\lbrack j\rbrack} = \frac{\alpha + \beta + \gamma}{\frac{\alpha}{{f\left\lbrack {i - 1} \right\rbrack}\lbrack j\rbrack} + \frac{\beta}{{f\lbrack i\rbrack}\left\lbrack {j - 1} \right\rbrack} + \frac{\gamma}{{f\lbrack i\rbrack}\lbrack j\rbrack}}},$wherein m and n are positive integers, and α, β, and γ are positiveintegers.
 8. The method of claim 1, wherein the producing of the secondpredicted coding unit comprises changing the value of each one of pixelsof the first predicted coding unit to a weighted geometric average ofvalues of at least one neighboring pixel of the each one of pixels ofthe first predicted coding unit and the each one of pixels of the firstpredicted coding unit.
 9. The method of claim 8, wherein, if a size ofthe first predicted coding unit is m×n, a value of a first pixel, whichis to be changed and is located at an i^(th) column and a j^(th) row ofthe first predicted coding unit, is f[i][j], a value of a second pixellocated to the left of the first pixel is f[i][j−1], and a value of athird pixel located above the first pixel is f[i−1][j], then theproducing of the second predicted coding unit further comprises changingthe value of the first pixel to f′[i][j] by using a following equation:${{{f^{\prime}\lbrack i\rbrack}\lbrack j\rbrack} = \left( {{{f\left\lbrack {i - 1} \right\rbrack}\lbrack j\rbrack}^{\alpha}*{{f\lbrack i\rbrack}\left\lbrack {j - 1} \right\rbrack}^{\beta}*{{f\lbrack i\rbrack}\lbrack j\rbrack}^{\gamma}} \right)^{\frac{1}{({\alpha + \beta + \gamma})}}},$wherein m and n are positive integers, and α, β, and γ are positiveintegers
 10. The method of claim 1, wherein the producing of the secondpredicted coding unit comprises changing the value of the each one ofpixels of the first predicted coding unit to an average of values of atleast one of pixels located above and to the left of the each one ofpixels of the first predicted coding unit and the each one of pixels ofthe first predicted coding unit.
 11. The method of claim 1, wherein theproducing of the second predicted coding unit comprises changing thevalue of the each one of pixels of the first predicted coding unit to amedian between the value of the each one of pixels of the firstpredicted coding unit and values of neighboring pixels of the each oneof pixels of the first predicted coding unit.
 12. The method of claim 1,wherein, if a size of the first predicted coding unit is m×n, a value ofa first pixel, which is to be changed and is located an i^(th) columnand a j^(th) row of the first predicted coding unit, is f[i][j], and avalue of a pixel, which is located at the same j^(th) row as the firstpixel from among pixels included in a border region of a coding unitadjacent to the top of the current coding unit, is f[−1][j], then theproducing of the second predicted coding unit comprises changing thevalue of the first pixel to f′[i][j] by using a following equation:${{{f^{\prime}\lbrack i\rbrack}\lbrack j\rbrack} = \frac{{{f\lbrack i\rbrack}\lbrack j\rbrack} + {{f\left\lbrack {- 1} \right\rbrack}\lbrack j\rbrack}}{2}},$wherein m and n are positive integers.
 13. The method of claim 1,wherein, if a size of the first predicted coding unit is m×n, a value ofa first pixel, which is to be changed and is located an i^(th) columnand a j^(th) row of the first predicted coding unit, is f[i][j], and avalue of a pixel, which is located at the same i^(th) column as thefirst pixel from among pixels included in a border region of a codingunit adjacent to the left of the current coding unit, is f[i][−j], thenthe producing of the second predicted coding unit comprises changing thevalue of the first pixel to f′[i][j] by using a following equation:${{{f^{\prime}\lbrack i\rbrack}\lbrack j\rbrack} = \frac{{{f\lbrack i\rbrack}\lbrack j\rbrack} + {{f\lbrack i\rbrack}\left\lbrack {- 1} \right\rbrack}}{2}},$wherein m and n are positive integers.
 14. The method of claim 1,wherein, if a size of the first predicted coding unit is m×n, a value ofa first pixel, which is to be changed and is located an i^(th) columnand a j^(th) row of the first predicted coding unit, is f[i][j], a valueof a pixel, which is located at the same j^(th) row as the first pixelfrom among pixels included in a border region of a coding unit adjacentto the top of the current coding unit, is f[−i][j], and a value of apixel, which is located at the same i^(th) column as the first pixelfrom among pixels included in a border region of a coding unit adjacentto the left of the current coding unit, is f[i][−j], then the producingof the second predicted coding unit comprises changing the value of thefirst pixel to f′[i][j] by using a following equation:${{f^{\prime}\lbrack i\rbrack}\lbrack j\rbrack} = {\frac{{2{{f\lbrack i\rbrack}\lbrack j\rbrack}} + {{f\lbrack i\rbrack}\left\lbrack {- 1} \right\rbrack} + {{f\left\lbrack {- 1} \right\rbrack}\lbrack j\rbrack}}{4}.}$wherein m and n are positive integers.
 15. The method of claim 1,wherein, if a size of the first predicted coding unit is m×n, and avalue of a first pixel, which is to be changed and is located an i^(th)column and a j^(th) row of the first predicted coding unit, is f[i][j],then the producing of the second predicted coding unit compriseschanging the value of the first pixel to f′[i][j] by using one offollowing equations:f′[i][j]=min(f[i][j]+i,255),f′[i][j]=min(f[i][j]+j,255),f′[i][j]=max(f[i][j]−i,0), andf′[i][j]=max(f[i][j]−j,0), wherein m and n are positive integers. 16.The method of claim 1, wherein, if a size of the first predicted codingunit is m×n, a value of a first pixel, which is to be changed and islocated at an i^(th) column and a j^(th) row of the first predictedcoding unit, is f[i][j], a value of a pixel located at a leftmost pointof the first predicted coding unit is f[0][0], a pixel located at thesame j^(th) row as the first pixel and located at an leftmost column ofthe first predicted coding unit is f[0][j], a value of a pixel locatedat the same i^(th) column as the first pixel and located at a uppermostrow of the first predicted coding unit is f[i][0], andG[i][j]=f[i][0]+f[0][j]−f[0][0], then the producing of the secondpredicted coding unit comprises changing the value of the first pixel tof′[i][j] by using a following equation:f′[i][j]=(f[i][j]+G[i][j])/2, wherein m and n are positive integers. 17.The method of claim 1, wherein the encoding of the differences betweenthe current coding unit and the second predicted coding unit comprisescomparing costs of bitstreams containing results of encoding secondpredicted coding units produced using different operation modes with oneanother, and adding information regarding an operation mode used forproducing a second predicted coding unit having a minimum cost to apredetermined region of a bitstream.
 18. The method of claim 16, whereinthe encoding of the differences between the current coding unit and thesecond predicted coding unit comprises representing different operationmodes to be differentiated from one another by assigning a small numberof bits to an operation mode that is most frequently used from among thedifferent operation modes, based on a distribution of an operation modedetermined when a predetermined number of coding units are encoded. 19.An apparatus for encoding video, the apparatus comprising: a predictorwhich produces a first predicted coding unit of a current coding unitthat is to be encoded; a post-processor which produces a secondpredicted coding unit by changing a value of each one of pixels of thefirst predicted coding unit by using the each one of pixels of the firstpredicted coding unit and at least one neighboring pixel of the each oneof pixels of the first predicted coding unit; and an encoder whichencodes differences between the current coding unit and the secondpredicted coding unit.
 20. A method of decoding video, the methodcomprising: extracting information regarding a prediction mode of acurrent decoding unit, which is to be decoded, from a receivedbitstream; reproducing a first predicted decoding unit of the currentdecoding unit, based on the extracted information regarding theprediction mode; extracting information regarding an operation mode, inwhich each of pixels of the first predicted decoding unit andneighboring pixels of each of pixels of the first predicted decodingunit are used, from the bitstream; reproducing a second predicteddecoding unit by changing a value of each of pixels of the firstpredicted decoding unit by using the each of pixels of the firstpredicted decoding unit and neighboring pixels of each of pixels of thefirst predicted decoding unit, based on the extracted informationregarding the operation mode; extracting a residual block, whichcomprises differences between the current decoding unit and the secondpredicted decoding unit, from the bitstream and restoring the residualblock; and decoding the current decoding unit by adding the residualblock to the second predicted decoding unit.
 21. The method of claim 20,wherein the reproducing of the second predicted decoding unit compriseschanging the value of each of pixels of the first predicted decodingunit to a weighted average of values of at least one neighboring pixelof each of pixels of the first predicted decoding unit and each ofpixels of the first predicted decoding unit.
 22. The method of claim 21,wherein, if a size of the first predicted decoding unit is m×n, a valueof a first pixel, which is to be changed and is located at an i^(th)column and a j^(th) row of the first predicted decoding unit, isf[i][j], and values of two neighboring pixels selected from amongneighboring pixels f[i][j−1], f[i−1][j], f[i+1][j], f[i][j+1],f[i−1][j+1], f[i+1][j−1], f[i−1][j−1], and f[i+1][j+1] of the firstpixel are f1 and f2, respectively, then the reproducing of the secondpredicted decoding unit further comprises changing the value of thefirst pixel to f′[i][j] by using a following equation:${{{f^{\prime}\lbrack i\rbrack}\lbrack j\rbrack} = \frac{{f\; 1} + {f\; 2} + {2*{{f\lbrack i\rbrack}\lbrack j\rbrack}}}{4}},$wherein m and n are positive integers.
 23. The method of claim 21,wherein, if a size of the first predicted decoding unit is m×n, a valueof a first pixel, which is to be changed and is located at an i^(th)column and a j^(th) row of the first predicted decoding unit, isf[i][j], and three neighboring pixels selected from among neighboringpixels f[i][j−1], f[i−1][j], f[i+1][j], f[i][j+1], f[i−1][j+1],f[i+1][j−1], f[i−1][j−1], and f[i+1][j+1] of the first pixel are f1, f2,and f3, respectively, then the reproducing of the second predicteddecoding unit further comprises changing the value of the first pixel tof′[i][j] by using a following equation:${{{f^{\prime}\lbrack i\rbrack}\lbrack j\rbrack} = \frac{{f\; 1} + {f\; 2} + {f\; 3} + {{f\lbrack i\rbrack}\lbrack j\rbrack}}{4}},$wherein m and n are positive integers.
 24. The method of claim 20,wherein the reproducing of the second predicted decoding unit compriseschanging the value of each of pixels of the first predicted decodingunit to a weighted harmonic average of values of at least oneneighboring pixel of each of pixels of the first predicted decoding unitand each of pixels of the first predicted decoding unit.
 25. The methodof claim 24, wherein, if a size of the first predicted decoding unit ism×n, a value of a first pixel, which is to be changed and is located atan i^(th) column and a j^(th) row of the first predicted decoding unit,is f[i][j], a value of a second pixel located to the left of the firstpixel is f[i][j−1], and a value of a third pixel located above the firstpixel is f[i−1][j], then the reproducing of the second predicteddecoding unit further comprises changing the value of the first pixel tof′[i][j] by using a following equation:${{{f^{\prime}\lbrack i\rbrack}\lbrack j\rbrack} = \frac{\alpha + \beta + \gamma}{\frac{\alpha}{{f\left\lbrack {i - 1} \right\rbrack}\lbrack j\rbrack} + \frac{\beta}{{f\lbrack i\rbrack}\left\lbrack {j - 1} \right\rbrack} + \frac{\gamma}{{f\lbrack i\rbrack}\lbrack j\rbrack}}},$wherein m and n are positive integers, and α, β, and γ are positiveintegers.
 26. The method of claim 20, wherein the reproducing of thesecond predicted decoding unit comprises changing the value of each ofpixels of the first predicted decoding unit to a weighted geometricaverage of values of at least one neighboring pixel of each of pixels ofthe first predicted decoding unit and the each of pixels of the firstpredicted decoding unit.
 27. The method of claim 26, wherein, if a sizeof the first predicted decoding unit is m×n, a value of a first pixel,which is to be changed and is located at an i^(th) column and a j^(th)row of the first predicted decoding unit, is f[i][j], a value of asecond pixel located to the left of the first pixel is f[i][j−1], and avalue of a third pixel located above the first pixel is f[i−1][j], thenthe reproducing of the second predicted decoding unit further compriseschanging the value of the first pixel to f′[i][j] by using a followingequation:${{{f^{\prime}\lbrack i\rbrack}\lbrack j\rbrack} = \left( {{{f\left\lbrack {i - 1} \right\rbrack}\lbrack j\rbrack}^{\alpha}*{{f\lbrack i\rbrack}\left\lbrack {j - 1} \right\rbrack}^{\beta}*{{f\lbrack i\rbrack}\lbrack j\rbrack}^{\gamma}} \right)^{\frac{1}{\alpha + \beta + \gamma}}},$wherein m and n are positive integers, and α, β, and γ are positiveintegers
 28. The method of claim 20, wherein the reproducing of thesecond predicted decoding unit comprises changing the value of each ofpixels of the first predicted decoding unit to an average of values ofat least one of pixels located above and to the left of each of pixelsof the first predicted decoding unit and the each of pixels of the firstpredicted decoding unit.
 29. The method of claim 20, wherein thereproducing of the second predicted decoding unit comprises changing thevalue of each of pixels of the first predicted decoding unit to a medianbetween the value of each of pixels of the first predicted decoding unitand values of neighboring pixels of each of pixels of the firstpredicted decoding unit.
 30. The method of claim 20, wherein, if a sizeof the first predicted decoding unit is m×n, a value of a first pixel,which is to be changed and is located an i^(th) column and a j^(th) rowof the first predicted decoding unit, is f[i][j], and a value of apixel, which is located at the same j^(th) row as the first pixel fromamong pixels included in a border region of a decoding unit adjacent tothe top of the current decoding unit, is f[−1][j], then the reproducingof the second predicted decoding unit comprises changing the value ofthe first pixel to f′[i][j] by using a following equation:${{{f^{\prime}\lbrack i\rbrack}\lbrack j\rbrack} = \frac{{{f\lbrack i\rbrack}\lbrack j\rbrack} + {{f\left\lbrack {- 1} \right\rbrack}\lbrack j\rbrack}}{2}},$wherein m and n are positive integers.
 31. The method of claim 20,wherein, if a size of the first predicted decoding unit is m×n, a valueof a first pixel, which is to be changed and is located an i^(th) columnand a j^(th) row of the first predicted decoding unit, is f[i][j], and avalue of a pixel, which is located at the same i^(th) column as thefirst pixel from among pixels included in a border region of a decodingunit adjacent to the left of the current decoding unit, is f[i][−j],then the reproducing of the second predicted decoding unit compriseschanging the value of the first pixel to f′[i][j] by using a followingequation:${{{f^{\prime}\lbrack i\rbrack}\lbrack j\rbrack} = \frac{{{f\lbrack i\rbrack}\lbrack j\rbrack} + {{f\lbrack i\rbrack}\left\lbrack {- 1} \right\rbrack}}{2}},$wherein m and n are positive integers.
 32. The method of claim 20,wherein, if a size of the first predicted decoding unit is m×n, a valueof a first pixel, which is to be changed and is located an i^(th) columnand a j^(th) row of the first predicted decoding unit, is f[i][j], avalue of a pixel, which is located at the same j^(th) row as the firstpixel from among pixels included in a border region of a decoding unitadjacent to the top of the current decoding unit, is f[−i][j], and avalue of a pixel, which is located at the same i^(th) column as thefirst pixel from among pixels included in a border region of a decodingunit adjacent to the left of the current decoding unit, is f[i][−j],then the reproducing of the second predicted decoding unit compriseschanging the value of the first pixel to f′[i][j] by using a followingequation:${{f^{\prime}\lbrack i\rbrack}\lbrack j\rbrack} = {\frac{{2{{f\lbrack i\rbrack}\lbrack j\rbrack}} + {{f\lbrack i\rbrack}\left\lbrack {- 1} \right\rbrack} + {{f\left\lbrack {- 1} \right\rbrack}\lbrack j\rbrack}}{4}.}$wherein m and n are positive integers.
 33. The method of claim 20,wherein, if a size of the first predicted decoding unit is m×n, and avalue of a first pixel, which is to be changed and is located an i^(th)column and a j^(th) row of the first predicted decoding unit, isf[i][j], then the reproducing of the second predicted decoding unitcomprises changing the value of the first pixel to f′[i][j] by using oneof following equations:f′[i][j]=min(f[i][j]+i,255),f′[i][j]=min(f[i][j]+j,255),f′[i][j]=max(f[i][j]−i,0), andf′[i][j]=max(f[i][j]−j,0), wherein m and n are positive integers. 34.The method of claim 20, wherein, if a size of the first predicteddecoding unit is m×n, a value of a first pixel, which is to be changedand is located at an i^(th) column and a j^(th) row of the firstpredicted decoding unit, is f[i][j], a value of a pixel located at aleftmost point of the first predicted decoding unit is f[0][0], a pixellocated at the same j^(th) row as the first pixel and located at anleftmost column of the first predicted decoding unit is f[0][j], a valueof a pixel located at the same i^(th) column as the first pixel andlocated at a uppermost row of the first predicted decoding unit isf[i][0], and G[i][j]=f[i][0]+f[0][j]−f[0][0], then the reproducing ofthe second predicted decoding unit comprises changing the value of thefirst pixel to f′[i][j] by using a following equation:f′[i][j]=(f[i][j]+G[i][j])/2, wherein m and n are positive integers. 35.An apparatus for decoding video, the apparatus comprising: an entropydecoder which extracts information regarding a prediction mode of acurrent decoding unit, which is to be decoded, and information regardingan operation mode, in which each of pixels of a first predicted decodingunit of the current decoding unit and neighboring pixels of each ofpixels of the first predicted decoding unit are used, from a receivedbitstream; a predictor which reproduces the first predicted decodingunit, based on the extracted information regarding the prediction mode;a post-processor which reproduces a second predicted decoding unit bychanging a value of each of pixels of the first predicted decoding unitby using each of pixels of the first predicted decoding unit andneighboring pixels of each of pixels of the first predicted decodingunit, based on the extracted information regarding the operation mode;an inverse transformation and inverse quantization unit which reproducesa residual block that is the difference between the current decodingunit and the second predicted decoding unit, from the bitstream; and anadder which decodes the current decoding unit by adding the residualblock to the second predicted decoding unit.
 36. A computer readablerecording medium having recorded thereon program code for executing themethod of claim
 1. 37. A computer readable recording medium havingrecorded thereon program code for executing the method of claim 20.